#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define N 500
#define mod 1000000007
using namespace std;
int solve(int l,int r);
int n,k,f[N+5][N+5],g[N+5][N+5],ans[N+5];
char s[N+5];
int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%d %d %s",&n,&k,s+1);
	for(int r=1;r<=n;++r) if(s[r]==')' || s[r]=='?')
		for(int l=r-1;l;--l) if(s[l]=='(' || s[l]=='?')
		{
			if(l+1==r) f[l][r]=1;
			else
			{
				f[l][r]=g[l+1][r-1];
				for(int i=l+1;i<r-1 && i-l<=k && (s[i]=='*' || s[i]=='?');)
					f[l][r]=(f[l][r]+g[++i][r-1])%mod;
				int j=r-1;for(;j>l+1 && r-j<=k && (s[j]=='*' || s[j]=='?');)
					f[l][r]=(f[l][r]+g[l+1][--j])%mod;
				if(j==l+1 && (s[j]=='*' || s[j]=='?') && r-j<=k) f[l][r]=(f[l][r]+1)%mod;
			}
			for(int i=l,j=i,now=0;i<r;++i)
			{
				now=(now-g[i][r]+mod)%mod;
				if(i==j) now=g[++j][r];
				while(j<r && j-i<=k && (s[j]=='*' || s[j]=='?')) now=(now+g[++j][r])%mod;
				g[l][r]=(g[l][r]+1ll*f[l][i]*now)%mod;
			}
			g[l][r]=(g[l][r]+f[l][r])%mod;
		}
	printf("%d",g[1][n]);
	return 0;
}
